/*
 *  (C) Copyright 2008 Insula Tecnologia da Informacao Ltda.
 * 
 *  This file is part of Vulcano.
 *
 *  Vulcano is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Vulcano is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Vulcano.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openinsula.vulcano.orm.dao.query.spec;

public abstract class SpecFactory {

	public static AndSpec and(final Spec... expressions) {
		return new AndSpec(expressions);
	}

	public static OrSpec or(final Spec... expressions) {
		return new OrSpec(expressions);
	}

	public static <T> EqualsSpec<T> eq(final String propertyName, final T value) {
		return new EqualsSpec<T>(propertyName, value);
	}

	public static <T> NotEqualsSpec<T> ne(final String propertyName, final T value) {
		return new NotEqualsSpec<T>(propertyName, value);
	}

	public static <T> GreaterSpec<T> gt(final String propertyName, final T value) {
		return new GreaterSpec<T>(propertyName, value);
	}

	public static <T> GreaterOrEqualSpec<T> ge(final String propertyName, final T value) {
		return new GreaterOrEqualSpec<T>(propertyName, value);
	}

	public static <T> LesserSpec<T> lt(final String propertyName, final T value) {
		return new LesserSpec<T>(propertyName, value);
	}

	public static <T> LesserOrEqualSpec<T> le(final String propertyName, final T value) {
		return new LesserOrEqualSpec<T>(propertyName, value);
	}

	public static BetweenSpec between(final String propertyName, final Object firstValue, final Object secondValue) {
		return new BetweenSpec(propertyName, firstValue, secondValue);
	}

	public static <T> InSpec<T> in(final String propertyName, final T... values) {
		return new InSpec<T>(propertyName, values);
	}

	public static LikeSpec like(final String propertyName, final String value) {
		return new LikeSpec(propertyName, value);
	}

	public static LikeSpec ilike(final String propertyName, final String value) {
		return new LikeSpec(propertyName, value, false);
	}

	public static NullSpec isNull(final String propertyName) {
		return new NullSpec(propertyName);
	}

	public static NotNullSpec isNotNull(final String propertyName) {
		return new NotNullSpec(propertyName);
	}
}
